<include file="public@header" />
<style>
th{
	font-size:14px;
}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
        	<li><a href="{:url('RockOrder/index')}">石材下单列表</a></li>
            <li><a href="{:url('RockOrder/orderinfo')}"> 采购订单</a></li>
			<li class="active"><a href="{:url('RockOrder/checkin')}">验收入库</a></li>
		</ul>
        <form  class="form-horizontal js-ajax-form" method="post" action="{:url('RockOrder/checkin')}" enctype="multipart/form-data">
            <div class="p_title">
                <span class="span_title">订单信息</span>
            </div>
            <fieldset>
                <div class="col-md-12"  style="border:1px solid #e2e2e2; padding-top:20px;">
                    <div class="form-group">
                        <input type="hidden" name="pact[purchase_id]" value="{$result.purchase_id|default=''}"  />
                        <label class="control-label">合同编号</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control"  value="{$result.pact_num|default=''}" disabled>
                        </div>
                        <label class="control-label">合同名称</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control"  value="{$result.pact_name|default=''}" disabled>
                        </div>
                        <label class="control-label">供货商名称</label>
                        <div class="col-md-2">
                            <select name="pact[supplier]" disabled  class="form-control">
                                <foreach name="userlist" item="vou">
                                    <if condition=" isset($result['supplier'])">
                                        <option value="{$vou.id}" <if condition=" $result['supplier'] eq $vou.id"> selected </if>>{$vou.department_name}-{$vou.user_nickname}</option>
                                        <else/>
                                        <option value="{$vou.id}">{$vou.department_name}-{$vou.user_nickname}</option>
                                    </if>
                                </foreach>
                            </select>
                        </div>
                        <label class="control-label">下单时间</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control"  value="{$result.add_time|date='Y-m-d H:i '}" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">预期交付时间</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control" value="{$result.due_time|date='Y-m-d H:i '}" disabled>
                        </div>
                        <label class="control-label">交货地点</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control"  value="{$result.trading_address|default=''}" disabled>
                        </div>
                        <label class="control-label">订单总价</label>
                        <div class="col-md-2" style="width: 21%">
                            <if condition=" $result['total_price'] eq 0"> </if>
                            <input type="text" class="form-control"  value="{$result.total_price}" style="width:150px;" disabled>
                            <input type="checkbox" id="include" name="pact[include]"   <if condition=" $result['delivery_fee'] eq 0">checked disabled</if>  > 含运费
                            <input type="checkbox" id="tax" name="pact[tax]"    <if condition=" $result['tax_price'] eq 0">checked disabled</if> > 含税金
                        </div>
                        <label class="control-label" style="width: 62px">到付运费</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control" id="payfor"  value="{$result.delivery_fee|default=''}"  <if condition=" $result['delivery_fee'] eq 0">disabled </if> disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">税金</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control" id="tax_price"  value="{$result.tax_price|default=''}" disabled>
                        </div>
                        <label class="control-label">下单人</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control"  value="{$result.add_user_name}" disabled>
                        </div>
                        <label class="control-label">订单备注</label>
                        <div class="col-md-5">
                            <textarea rows="1" disabled  name="pact[order_notes]"class="form-control" placeholder="请输入0-200字的反馈说明" style="width:100%">{$result.order_notes|default=''}</textarea>
                            <input type="hidden" name="pact[order_notes]" value="{$result.order_notes|default=''}">
                        </div>
                    </div>
                    <div class="form-group">
<!--                        <label class="control-label">入库单号</label>-->
<!--                        <div class="col-md-2">-->
<!--                            <input type="text" class="form-control"  value="2024521" disabled>-->
<!--                        </div>-->
                        <label class="control-label">验收人</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control" name="pact[acceptor_user]"  value="{$result.acceptor_user|default=''}" disabled>
                        </div>
                        <label class="control-label">入库人</label>
                        <div class="col-md-2">
                            <input type="text" class="form-control"  name="pact[warehousing_user]"  value="{$result.warehousing_user|default=''}" disabled>
                        </div>
                    </div>
                </div>
            </fieldset>
            <div class="p_title">
                <span class="span_title">验货入库</span>
            </div>
            <fieldset>
            <div class="col-md-12" style="border:1px solid #e2e2e2; padding-top:20px;">
                <div class="row">
                    <div class="col-md-12">
                        <div style="margin-left:40px;margin-bottom:15px"><strong style="color:#2fa4e7">下单产品</strong>（<span style="color:red">要组成以下产品：</span>执行合成后以下产品数量增加）</div>

                        <table class="table table-hover table-bordered" style="margin:0 auto; width:96%;">
                            <thead>
                            <tr>
                                <th >{:lang('产品名称')}</th>
                                <th>{:lang('墓体规格')}</th>
<!--                                <th>{:lang('材质')}</th>-->
                                <th>{:lang('单位')}</th>
                                <th>{:lang('订单数量')}</th>
                                <th>{:lang('实际合成数量')}</th>
                                <th>{:lang('未合成数量')}</th>
                                <th>{:lang('可使用数量')}</th>
                                <th>{:lang('应用位置')}</th>
                                <th>{:lang('存放位置')}</th>
                                <th>{:lang('操作')}</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="result_order" item="pvo">
                                <tr class="pro_id_{$pvo.pro_id} po_id_{$pvo.po_id} ">
                                    <input type="hidden" name="order[{$key}][po_id]" value="{$pvo.po_id|default=''}"  />
<!--                                    <input type="hidden" name="order[{$key}][match_usable]" value="{$pvo.match_usable|default=''}"  />-->
                                    <td><a href="javascript:void(0);"
                                           class="pro_name"
                                           data-href="{:url('ajaxProduct')}?type=1&pro_id={$pvo['pro_id']}&purchase_id={$pvo.purchase_id}"
                                           data-purchase_id="{$pvo.purchase_id}"
                                           data-pro_id="{$pvo.pro_id}"
                                           data-po_id="{$pvo.po_id}"
                                           data-total_num="{$pvo.total_num}"
                                           data-sy="{$pvo.total_num-$pvo.match_actual}"
                                           data-match_actual="{$pvo.match_actual}"
                                           data-history_record="{:url('history_record')}"
                                    >{$pvo.pro_name}</a></td>
                                    <td>{$pvo.pro_length}mm*{$pvo.pro_width}mm*{$pvo.pro_height}mm</td>
<!--                                    <td>花岗岩</td>-->
                                    <td>{$pvo.unit}</td>
                                    <td>{$pvo.total_num}
                                        <input type="hidden" class="total_num" name="order[{$key}][total_num]"  value="{$pvo.total_num}"  /></td>
                                    <td>
                                        <label style="font-weight: normal;" class="match_actual">{$pvo.match_actual|default='0'}</label>
                                        <input type="hidden" class="match_actual_num" name="order[{$key}][match_actual_num]" />
                                        <input type="hidden" class="match_actual" name="order[{$key}][match_actual]" value="{$pvo.match_actual|default='0'}"  />
                                        <input type="hidden" class="status_enter" name="order[{$key}][status_enter]" value="{$pvo.status_enter|default='1'}"  />
                                    </td>
                                    <td>
                                        <input type="hidden" class="match_not" name="order[{$key}][match_not]" value="{$pvo.match_not|default='0'}"  />
                                        <label style="font-weight: normal;" class="match_not">{$pvo.match_not|default='0'}</label>
                                    </td>
                                    <td>
                                        <input type="hidden" class="match_usable" name="order[{$key}][match_usable]" value="{$pvo.match_usable|default='0'}"  />
                                        <label style="font-weight: normal;" class="match_usable">{$pvo.match_usable|default='0'}</label>
                                    </td>
                                    <td>{$pvo.application_location}</td>
                                    <td><input type="text" class="form-control" name="order[{$key}][storage_location]" value="{$pvo.storage_location|default=''}" /></td>
                                    <td>
                                        <a href="javascript:;" data-title="产品详细资料" data-href="{:url('ajaxProduct')}?type=2&pro_id={$pvo.pro_id}" class="lock-pro_info"  data-pro_id="{$pvo['pro_id']}">{:lang('产品详细资料')}</a>
                                        |
                                        <a href="javascript:;" data-title=" 合成记录（{$pvo.pro_name}） " data-href="{:url('synthetic_record')}?po_id={$pvo.po_id}" class="lock-pro_info" >{:lang('合成记录')}</a>

                                        <!--<if condition="$pvo.match_usable eq 0 "> -->
                                        <if condition="$pvo.match_not gt 0 ">
                                            |
                                            <a href="javascript:;" disabled="true" data-title="匹配出库" data-href="">{:lang('匹配出库')}</a>
                                        </if>
                                        <!--<else  /> 生态墓-->
                                            |
                                            <a href="{:url('outbound')}?pro_id={$pvo.pro_id}&purchase_id={$pvo.purchase_id}&usabled={$pvo.match_usable} "   data-title=" 匹配出库" data-href="">{:lang('匹配出库')}</a>

                                        <!--</if>-->

                                    </td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                    </div>
                    <div class="col-md-12" style="border-top:1px solid #e2e2e2;padding-top:20px;">
                        <div style="margin-left:40px;margin-bottom:15px"><strong style="color:#2fa4e7">产品构件</strong>（<span style="color:red">要组成以下产品：</span>执行合成后以下构件数量减少）</div>

                        <table class="layui-hide" id="product_part_info" lay-filter="product_part"></table>

                        <table class="table table-hover table-bordered" id="product_part" style="margin:0 auto; width:100%;">
                            <thead>
                            <tr>
                                <th><label>
                                    <input type="checkbox" class="js-check-all"  id="ischange" >
                                </label></th>
                                <th>{:lang('构件名称')}</th>
                                <th>{:lang('规格（mm）')}</th>
                                <th>{:lang('材质')}</th>
                                <th>{:lang('合成所需数量')}</th>
                                <th>{:lang('单位')}</th>
                                <th>{:lang('已到货数量')}</th>
                                <th>{:lang('应到货数量')}</th>
                                <th>{:lang('实到货数量')}</th>
                                <th>{:lang('验收入库数量')}</th>
                                <th>{:lang('退货数量')}</th>
                                <th>{:lang('需补货数量')}</th>
                                <th>{:lang('操作')}</th>
                            </tr>
                            </thead>
                            <tbody id="product_info">
                            </tbody>
                           <input type="hidden" id="pro_id" name="product[pro_id]"  />
                           <input type="hidden" id="po_id" name="product[po_id]"  />
                        </table>
                        <div class="pagination">{$page}</div>
                    </div>
                </div>
            </div>
            </fieldset>

            <div class="form-actions">
                <input type="hidden" class="status_enter" name="pact[status_enter]" value="{$result.status_enter|default='1'}"  />
                <input type="hidden" name="type" id="type" value="0"  />
<!--                <if condition=" $result['status_enter'] eq 1">-->
                <!--                </if>-->
                    <div class="btn btn-primary" id="check-synthesis">合成入库</div>

<!--             <div class="btn btn-primary" id="check-btn">保存</div>-->
             <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
         </div>
     </form>
 </div>
 <script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>
 <script type="text/javascript" src="__STATIC__/js/layer/layer.js"></script>
 <link href="__STATIC__/js/bootstrap-table/dist/bootstrap-table.css" rel="stylesheet"/>
 <script src="__STATIC__/js/bootstrap-table/dist/bootstrap-table.js"></script>
 <script src="__STATIC__/js/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>  
 <script type="text/javascript" src="__STATIC__/js/Warehousing.js?v={:time()}"></script>

 <style>

     #photos{
         list-style: none;
         margin: 0px;
         padding: 0px;
     }
     #photos li{
         width: 198px;
         height: 208px;
         text-align: center;
         position: relative;
         display: inline;
         float: left;
         font-size: 12px;
         margin: 0px 8px 20px 0px;
         overflow: hidden;
     }
     #photos  li p.imgWrap {
         position: relative;
         z-index: 2;
         line-height: 133px;
         vertical-align: middle;
         width: 185px;
         height: 133px;
         transform-origin: 50% 50% 0px;
         overflow: hidden;
         transition: all 200ms ease-out 0s;
     }
 </style>
 <script type="text/html" id="photos-item-tpl">
     <li id="saved-image1{id}" style="width: 202px;float:left;height: 172px;text-align: center">
         <p class="imgWrap">
             <input id="photo-{id}" type="hidden" name="photo_urls1[]" class="hidden" value="{filepath}">
             <img id="photo-{id}-preview" src="{url}" style="width: 100%;" onclick="imagePreviewDialog(this.src);">
         </p>
         <p>
         <a href="javascript:uploadOneImage('图片上传','#photo-{id}');" style="font-size: 12px">替换</a>
         <a href="javascript:(function(){$('#saved-image1{id}').remove();})();" style="font-size: 12px">移除</a>
         </p>
     </li>
 </script>
</body>
</html>